package com.controller;

import com.po.User;
import com.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

//**
// 注解开发
// *//
@Controller
public  class UserController3 {

    @Autowired
    userService userservic;

    @RequestMapping("/getuser")
    public String getuser(HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {

        User user=userservic.findUserById1(1);
        model.addAttribute("user",user);
        return "/user";
    }

}
